package com.home.duy.code.components;

import java.awt.AlphaComposite;
import java.awt.Graphics;
import java.awt.Graphics2D;

import javax.swing.JButton;

public class TransparentButton extends JButton{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	public TransparentButton(String text)
	{
		super(text);
		setOpaque(false);
	}
	public TransparentButton()
	{
		super();
		setOpaque(false);
	}
	
	@Override
	public void paint(Graphics g) {
		Graphics2D g2d = (Graphics2D)g;
		g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER,0.5f));
		super.paint(g2d);
		g2d.dispose();
	}
}
